/**
 * Created by HUANG on 2016/1/21.
 */
'use strict';
angular.module('nec-admin.teacher')
    .controller('teacherController', ['$scope', '$state', 'teacherService','sweetAlert','toast',
        function ($scope, $state ,teacherService,sweetAlert,toast) {
            $scope.getStuScores = function() {
                teacherService.getStuScores(1).then(function(resp){
                    console.log(resp);
                    $scope.stuScores=resp;
                },function(){
                    toast.error('获取学生信息失败');
                });
            };

            $scope.getStuScores();
            $scope.score = function(stuId, sbjId, sc) {
                teacherService.score(stuId, sbjId, sc).then(function() {
                    $scope.getStuScores();
                });
            };
        }]);
